import { forBindEventThis } from '../../../../global_comps/Func/forBindEventThis';
import { user_login_dataMana } from './cla_user_login_dataMana';
import type { user_login_props } from './cla_user_login_props';

const user_login_operateTag = 'user_login_operate';

export class user_login_operate extends user_login_dataMana {
  get [Symbol.toStringTag]() {
    return user_login_operateTag;
  }

  constructor(props: user_login_props) {
    super(props);

    forBindEventThis(this);

    this.eventM.addEventListen(
      this.inp_account,
      'blur',
      this.eventBind.inp_account_blur
    );

    this.eventM.addEventListen(
      this.inp_passworld,
      'blur',
      this.eventBind.inp_passworld_blur
    );

    this.eventM.addEventListen(
      this.dom_submit,
      'click',
      this.eventBind.submit_click
    );
  }

  /**
   * 用户账户
   *
   * 失焦 测定
   */
  inp_account_blur() {
    this.set_cur_dom_val(this.inp_account);
  }

  /**
   * 用户 密码
   *
   * 失焦 测定
   */
  inp_passworld_blur() {
    this.set_cur_dom_val(this.inp_passworld);
  }

  /**
   * 提交 用户 登录 信息
   */
  async submit_click() {
    await this.submit_info();
  }
}
